package com.example.pattern.mediator;

/**
 * 应用
 *
 * @author FM_南风
 * @date 2024/7/6
 */
public class MediatorClient {
	public static void main(String[] args) {
		ConcreteMediator mediator = new ConcreteMediator();

		ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);
		ConcreteColleague2 colleague2 = new ConcreteColleague2(mediator);

		mediator.addColleague(colleague1);
		mediator.addColleague(colleague2);

		colleague1.sendMessage("Hello from Colleague1");
		colleague2.sendMessage("Hi from Colleague2");
	}
}